import axios from 'axios';

export default {
    install: function(Vue, options) {
        let service = {
            // 根据类型获取价格信息
            getPriceByCode(priceCode) {
                return axios.get(`/price/code/${priceCode}`);
            },

            // 根据类型获取价格
            getUnitPricesByType(priceType) {
                return axios.get(`/price/type/${priceType}/price`);
            },

            // 根据类型获取价格信息
            getPricesByType(priceType) {
                return axios.get(`/price/type/${priceType}`);
            },

            modifyPrice(price) {
                return axios.put('/price', price);
            }
        }

        Vue.prototype.$PriceService = service;
    }
};